﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Collections;
using System.Windows;
using Microsoft.SharePoint.Utilities;
using SharePointCommander.Model.PropertySheet;

namespace SharePointCommander.Model.TreeView
{
    public class SCProperties : TreeViewItem
    {
        protected SCTreeViewItem parentNode;

        public Hashtable Properties { get; set; }

        public SCTreeViewItem ParentNode
        {
            get { return parentNode; }
        }

        public SCProperties(SCTreeViewItem parent, Hashtable properties)
        {
            this.parentNode = parent;
            this.Properties = properties;
            Header = "Properties";
            ToolTip = properties.GetType().FullName;
        }

        //public SCProperties(SCTreeViewItem parent, SPPropertyBag properties)
        //{
        //    this.parentNode = parent;
        //    Properties = new Hashtable();
        //    foreach (string key in properties.Keys)
        //    {
        //        Properties[key] = properties[key];
        //    }
        //    Header = "Properties";
        //    ToolTip = properties.GetType().FullName;
        //}

        public void Update()
        {
            parentNode.Update();
        }
    }
}
